<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8" %>
<%@page import="org.ipo.mm.web.util.pager.MeetingPager, java.util.Collection, org.ipo.mm.web.util.security.SecurityManager" %>
<%@page  language="java"
         import="org.ipo.mm.web.util.*, java.util.ArrayList"%>
<%@taglib prefix="h" uri="http://struts.apache.org/tags-html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="b" uri="http://struts.apache.org/tags-bean"%>
<div class="header">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td  valign="top" >
                <div class="appTitle"><!--<b:message key="gen_app_title"/>-->
                <span style="margin-left:5px;"><img src="<%= request.getContextPath()%>/css/images/logo_<b:message key='gen_lang_short' />.png" width="462" height="60" />  </span>
                </div>
                <h:form action="/protected/quick_search">
                    <div class="searchBoxes">
                        <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="15" height="38" background="<%= request.getContextPath()%>/css/images/search_l.png" style="background-repeat:no-repeat">&nbsp;</td>
                                <td height="38" background="<%= request.getContextPath()%>/css/images/search_c.png" style="background-repeat:repeat-x"><b:message key="gen_search" />
                                    <h:text property="query" ></h:text>
                                    <h:checkbox property="meetings"> <b:message key="header_srch_meetings"/></h:checkbox>
                                    <h:checkbox property="representatives"> <b:message key="header_srch_representatives"/></h:checkbox>
                                    <h:checkbox property="institutions"> <b:message key="header_srch_institutions"/></h:checkbox>
                                    <h:submit><b:message key="gen_search" /></h:submit></td>
                                <td width="15" height="38" background="<%= request.getContextPath()%>/css/images/search_d.png" style="background-repeat:no-repeat">&nbsp;</td>
                            </tr>
                        </table>
                    </div>                    
                </h:form>
                <div style="float:left; clear:both; width:100%;">
                    <span style="font-weight: bolder; padding-right: 20px; float:left;"><b:message  key="gen_user"/> ${USER.username}</span>
                    <span style="padding-right: 20px; float: right">
                        <h:link action="/set_locale?language=en"><img src="<%= request.getContextPath()%>/icons/eng.png" width="42px" height="25px" align="top"/></h:link>
                        <h:link action="/set_locale?language=sr"><img src="<%= request.getContextPath()%>/icons/ser.png" width="37px" height="25px" align="top"/></h:link>
                    </span>
                    
                </div>
            </td>
            <!--<td width="81px" rowspan="2" valign="top"><div id="logo" /></td>-->
            <td rowspan="2" valign="top"><div id="logo" /></td>



        </tr>
        <tr>
            <td  valign="bottom">
                <div class="menu">
                    <h:link action="/protected/dispatch?method=showMainPage&clearStack=true"><b:message key="menu_main" /></h:link>
                    <h:link action="/protected/meeting_search?method=showMeetings&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/meeting.png" width="29px" height="28px" align="top"/> <b:message key="menu_meetings" /></h:link>
                    <h:link action="/protected/representative_search?method=showReprs&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/representative.png" width="29px" height="28px" align="top"/> <b:message key="menu_representatives" /></h:link>
                    <h:link action="/protected/institution_search?method=showInstitutions&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/institution.png" width="29px" height="28px" align="top"/> <b:message key="menu_institutions" /></h:link>
                    <h:link action="/protected/dispatch?method=showFamilies&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/family.png" width="29px" height="28px" align="top"/> <b:message key="menu_families" /></h:link>
                    <h:link action="/protected/dispatch?method=showTypes&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/type.png" width="29px" height="28px" align="top"/> <b:message key="menu_types" /></h:link>
                    <h:link action="/protected/dispatch?method=showRegions&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/region.png" width="29px" height="28px" align="top"/> <b:message key="menu_regions" /></h:link>
                    <h:link action="/protected/dispatch?method=showCities&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/city.png" width="29px" height="28px" align="top"/> <b:message key="menu_cities" /></h:link>



                    <%
            Collection<Integer> privileges = (Collection<Integer>) request.getSession().getAttribute(ConstantManager.SESSION_USER_PRIVILEGES);
            if (privileges.contains(SecurityManager.READ_USER_PRIVILEGE)) {%>

                    <h:link action="/protected/dispatch?method=showUsers&clearStack=true"><img src="<%= request.getContextPath()%>/icons/small/user.png" width="29px" height="28px" align="top"/> <b:message key="menu_users" /></h:link>

                    <%}%>


                    <h:link action="/protected/logout"><b:message key="menu_logout" /></h:link>
                    <a href="<%= request.getContextPath()%>/res/Help.pdf" target="_blank"><img src="<%= request.getContextPath()%>/icons/small/help.png" width="29px" height="28px" align="top"/> <b:message key="menu_help" /></a>
                </div>
            </td>
        </tr>
    </table>
</div>
<!--    <div>

<h:link action="/protected/dispatch?method=createType">Create type</h:link>        
<h:link action="/protected/dispatch?method=showCreateInstForm">Create institution</h:link>        
<h:link action="/protected/dispatch?method=showCreateReprForm">Create representative</h:link>
<h:link action="/protected/dispatch?method=showCreateMeetingForm">Create meeting</h:link>


</div>-->

